<?php
/**
 * Created by PhpStorm.
 * User: zhaojunlike
 * Date: 2016/12/1
 * Time: 13:10
 */

namespace Home\Controller;


class ServiceController extends AuthController
{

    public function getUserMsg($idCard)
    {
        $user = M('user')->where(array('u_pid' => $idCard))->find();
        if (!$user) {
            $this->error('对不起,用户不存在');
        }

        if ($user['u_type'] != 1) {
            $this->error('对不起,该会员未认证或者是机构');
        }
        $json['status'] = 1;
        $json['data'] = $user;
        $json['info'] = '';
        $this->ajaxReturn($json);
    }

    public function getProjectTotalData()
    {
        $total['t_count'] = intval(M('all_game')->where(array())->count());
        $time = date("YmdHis");
        $total['b_count'] = intval(M('all_game')->where("all_b_time<='$time' and all_e_time>='$time'")->count());
        $total['w_count'] = intval(M('all_game')->where("all_b_time>'$time'")->count());
        $total['e_count'] = intval(M('all_game')->where("all_e_time<'$time'")->count());

        $json['data'] = $total;
        $this->ajaxReturn($json);
    }
}